package com.okRPC.balancer;

import com.okRPC.common.ServiceInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;

/**
 * Description: This is a sample class.
 * Author: Simon
 * Date: 2023/10/10
 */
public class FullRoundBalance implements LoadBalance{

    private static Logger logger = LoggerFactory.getLogger(FullRoundBalance.class);

    private int index;

    @Override
    public ServiceInfo chooseOne(List<ServiceInfo> services) {

        if(index>=services.size()){
            index=0;
        }

        return services.get(index++);
    }
}
